<template>
    <div id="addbooks">
        书名:<input type="text" v-model="name"><br>
        阅读量:<input type="text" v-model="read"><br>
        评论量:<input type="text" v-model="commit"><br>
        发行时间:<input type="text" v-model="time"><br>
        <input type="button" value="添加" @click="addbook()">
    </div>
</template>
<script>
import {add_books}  from './axios_api/api.js'
export default {
    name:"",
    data(){
        return{
            name:"",
            read:"",
            commit:"",
            time:"",
        }
    },
    methods:{
        addbook(){
            var data={
            "name":this.name,
            "read":this.read,
            "commit":this.commit,
            "time":this.time
        }
        add_books(data)
        .then(res=>{
            console.log(res)
        })
        }
    }
}
</script>
<style>
    
</style>